<?php
/**
 * 系统日志
 *
 * @author maomao.thx@gmail.com
 * @copyright Copyright (c) 2009 Green Shore (http://www.iwgame.com)
 * @version $Id: LogController.php 1059 2011-11-18 09:26:15Z mmxie $
 */
class System_LogController extends IG_Controller_Action
{

    /**
     * 日志列表
     * @author maomao.thx@gmail.com
     */
    public function listAction ()
    {
        $report = IG_Data::factory('array', array(
            'source'  => array(
                'name'   => 'Model',
                'config' => array(
                    'model' => 'System_Model_Log',
                    'methodParams' => array(
                        array(
                            'employee=?' => 'employee',
                            'ltime like concat(?, "%")'    => 'ltime',
                        ),
                    ),
                ),
            ),
            'plugins' => array(
                array(
                    'name'   => 'DwzTable',
                    'config' => array(
                        'columns' => array(
                            'log_id'   => '日志ID',
                            'employee' => '操作者',
                            'priority' => '日志级别',
                            'ltime'    => '记录时间',
                            'message'  => '日志内容',
                        ),
                        'attrs' => array('layoutH' => 137),
                    )
                ),
                array(
                    'name'   => 'Params',
                    'config' => array(
                        'department_id' => array(
                            'title'     => '操作者',
                            'type'      => 'formText',
                            'default'   => '',
                        ),
                        'name'          => array(
                            'title' => '时间(左模糊)',
                            'type'  => 'formText',
                            'default'   => '',
                        ),
                    ),
                ),
            ),
        ));

        $report->loadPlugins();
    }
}